<%@ page import="njust.edu.entity.Dish" %>
<%@ page import="njust.edu.web.Page" %>
<%@ page import="java.util.List" %>
<%@ page import="njust.edu.entity.Trade" %>
<%@ page import="njust.edu.entity.User" %><%--
  Created by IntelliJ IDEA.
  User: funnyday
  Date: 2021/9/17
  Time: 15:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>查看订单</title>
    <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <style>
        p{
            font-family:georgia;
            font-weight: 500;
        }
        .header {
            font-size: 140%;
            opacity: 0.8;
            position: absolute;
            top: 0;
            width: 100%;
            height: 80px;
        }

        .header ul {
            list-style-type: none;
            background-color: #333;
            margin: 0;
            padding: 0;
            overflow: hidden;
            width: 100%;
            height: 80px;
        }

        .header li {
            float: left;
            height: 80px;
            width: 200px;
        }

        .header li a {
            display: block;
            color: white;
            text-align: center;
            padding: 30px;
            text-decoration: none;
            height: 80px;
        }

        .header li a:hover:not(.active) {
            background-color: #111;
        }
        .container{
            left: 400px;
            position:absolute;
            width:1500px;
            height:1100px;
            top:80px;
            align-self: center;
            background-color: 	#F5FFFA;
            opacity: 0.8;
            border-radius: 45px/150px;
        }


        .catalogue{
            position:relative;
            width:1350px;
            height:80px;
            left:50px;
            align-self: center;/*
            background-color: wheat; */
        }
        .cart_cata{
            position: relative;
            float: left;
            height: 60px;
            top: 10px;/*
            background-color: white; */
            margin-left: 20px;
            margin-right: 20px;
            padding-top: 20px;
            font-size: 200%;
            text-align: center;
        }
        .cart_list{
            position:relative;
            width:1350px;
            height:880px;
            left:50px;
            align-self: center;
            overflow: auto;/*
            background-color: white; */
        }
        .cart_item{
            position:relative;
            width:1300px;
            height:150px;
            left:0px;
            align-self: center;
            overflow: auto;
            float: left;/*
            background-color: lightblue; */
            margin-top: 20px;
            font-size: 140%;
            border-radius: 40px;
        }
        .cart_info{
            position: relative;
            float: left;
            height: 60px;/*
            background-color: white; */
            margin-left: 20px;
            margin-right: 20px;
            padding-top:10px;
            font-size: 150%;
            text-align: center;
        }
        .cart_pagination{
            position:relative;
            width:1350px;
            height:130px;
            left:50px;
            align-self: center;
            overflow: auto;/*
            background-color: white; */
            font-size: 250%;
            padding-left: 420px;
        }
        #cata_cartid{
            width: 200px;
        }
        #cata_tableid{
            width: 100px;
        }
        #cata_cartstate{
            width:160px;
        }
        #cata_cartprice{
            width: 200px;
        }
        #cata_carttime{
            width: 400px;
        }
        #cart_id{
            width: 200px;
        }
        #table_id{
            width: 100px;
        }
        #cart_state{
            width: 150px;
        }
        #cart_price{
            width: 200px;
        }
        #cart_time{
            width: 400px;
        }
    </style>
</head>
<body>
<div class = "backGround" style="position: relative;">
    <img src = "../img/trade.jpg" width="2402px" height="1202px">
    <div class="header">
        <%
            Page<Trade> page_list = (Page<Trade>)request.getAttribute("page");
            List<Trade> trade_list = page_list.getList();
            User user = (User) request.getAttribute("user");
        %>
        <ul>
            <li><a href="BookController?method=allDishList">菜单</a></li>
            <li><a href="CartController?method=toCartUI">购物车</a></li>
            <li><a href="TradeController?method=toTradeAllUI">订单</a></li>
            <li style="float: right"><a href="index.jsp" ><p>退出登录</p></a></li>
        </ul>
    </div>
    <div class = "container">
        <div class = "catalogue">
            <div class = "cart_cata" id = "cata_cartid">订单号</div>
            <div class = "cart_cata" id = "cata_tableid">桌号</div>
            <div class = "cart_cata" id = "cata_cartprice">总价格</div>
            <div class = "cart_cata" id = "cata_carttime">下单时间</div>
            <div class = "cart_cata" id = "cata_cartstate">订单状态</div>
        </div>
        <div class= "cart_list" >
            <%
                for(Trade trade:trade_list){
            %>
            <a href="TradeController?method=tradeInfo&tradeId=<%=trade.getId()%>">
            <button class = "cart_item">
                <div class = "cart_info" id = "cart_id"><p><%=trade.getId()%></p></div>
                <div class = "cart_info" id = "table_id"><p><%=trade.getCustomer_table()%></p></div>
                <div class = "cart_info" id = "cart_price"><p><%=trade.getPrice()%>元</p></div>
                <div class = "cart_info" id = "cart_time"><p><%=trade.getDate()%></p></div>
                <div class = "cart_info" id = "cart_state"><p><%=trade.getState()==1?"等待接收":"已接收"%></p></div>
            </button>
            </a>
            <%
                    break;
                }
            %>
        </div>
        <div class = "cart_pagination">
            <ul class="pagination" style="border-style: none; outline: none; border-radius: 20px;">
                <li class="page-item"><a class="page-link" style="border-style: none; outline: none;"
                                         href="TradeController?method=toTradeAllUI&pageNo=<%=(page_list.getPageNo()>1)?(page_list.getPageNo()-1):page_list.getPageNo()%>"><p>Previous</p></a></li>
                <li class="page-item"><a class="page-link" style="border-style: none; outline: none;"><p>第 <%=page_list.getPageNo()%> 页 /</p></a></li>

                <li class="page-item"><a class="page-link" style="border-style: none; outline: none;"><p>共 <%=page_list.getTotalPageNumber()%> 页</p></a></li>
                <li class="page-item"><a class="page-link" style="border-style: none; outline: none;"
                                         href="TradeController?method=toTradeAllUI&pageNo=<%=(page_list.getPageNo()<page_list.getTotalPageNumber())?(page_list.getPageNo()+1):page_list.getPageNo()%>"><p>Next</p></a></li>
            </ul>
        </div>
    </div>
</div>
</body>
</html>


